package com.zm.zmgz.configure;


import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration
public class DataSourceConfig {

    //    一个datasource
    @Bean
    @ConfigurationProperties(prefix = "spring.datasource.one")
    DataSource dataSource() {
        return DruidDataSourceBuilder.create().build();
    }

    //    另一个datasource
//    @Bean
//    @ConfigurationProperties(prefix = "spring.datasource.two")
//    DataSource dataSource2() {
//        return DruidDataSourceBuilder.create().build();
//    }
}
